ci: Repair regenerate-models workflow stale add glob and branch clash#809
Open
vdusek wants to merge 1 commit into
Open
ci: Repair regenerate-models workflow stale add glob and branch clash#809vdusek wants to merge 1 commit into
vdusek wants to merge 1 commit into
Conversation
The `add:` pathspec `_*_generated.py` stopped matching anything after the generated files were renamed (PR #765 dropped the `_generated` suffix), so the workflow has been silently producing no commits since 2026-04-29. After PR #792 swapped to `apify/actions/signed-commit`, the pre-existing local `git switch -c "$BRANCH"` step also clashed with the action's `create-branch: true` flow (its `git fetch ... $BRANCH:refs/heads/$BRANCH` refuses to overwrite a checked-out branch), leaving dangling empty branches like `update-models-docs-pr-2546` / `-2548`. This fixes the `add:` list to the actual filenames and skips the local branch creation when the remote branch doesn't yet exist, letting signed-commit handle that path; existing branches are still pre-checked-out locally and `create-branch` is set to `false` for that case.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #809 +/- ##
==========================================
- Coverage 94.52% 94.46% -0.07%
==========================================
Files 48 48
Lines 4916 4916
==========================================
- Hits 4647 4644 -3
- Misses 269 272 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two bugs in
.github/workflows/manual_regenerate_models.yamlthat, between them, are responsible for empty branches likeupdate-models-docs-pr-2546andupdate-models-docs-pr-2548being left dangling without PRs.Bug 1 — stale
add:glob (silent, since 2026-04-29)add: 'src/apify_client/_*_generated.py'matches nothing. PR #765 renamed the generated files from_models_generated.py/_typeddicts_generated.pyto_models.py,_typeddicts.py,_literals.py, but the workflow's pathspec and header comment weren't updated. Under the previousEndBug/add-and-commit@v10this just producedcommitted: falsewith no error — so the workflow has been exiting green while doing nothing for ~3 weeks.Bug 2 —
create-branch: trueclashes with the localgit switch -c "$BRANCH"(visible since #792 on 2026-05-15)apify/actions/signed-commit@v1.0.0withcreate-branch: trueruns:The push succeeds (creating the dangling remote branch at master's HEAD), but the fetch fails with
fatal: refusing to fetch into branch ... checked out at ...because the workflow's priorSwitch to existing branch or create a new onestep already checked out a local branch with the same name. The job exits 128, leaving the empty remote branch behind.Changes
_{models,typeddicts}_generated.py→_{models,typeddicts,literals}.py.git fetch origin "$BRANCH":"$BRANCH"(explicit local ref) for clarity.push + fetchwithout colliding.create_branch(true/false) for the commit step.add:enumerates the actually-generated files.create-branch:is now driven bysteps.branch-setup.outputs.create_branch.Follow-up
Once this lands, the two dangling branches should be deleted and the corresponding
Regenerate modelsworkflow re-triggered for those docs PRs (or the docs PRs re-synced).